package com.ruoyi.wechat.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wechat.mapper.AppointmentMapper;
import com.ruoyi.wechat.domain.Appointment;
import com.ruoyi.wechat.service.IAppointmentService;

/**
 * 营地预约Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-01
 */
@Service
public class AppointmentServiceImpl implements IAppointmentService 
{
    @Autowired
    private AppointmentMapper appointmentMapper;

    /**
     * 查询营地预约
     * 
     * @param appointId 营地预约主键
     * @return 营地预约
     */
    @Override
    public Appointment selectAppointmentByAppointId(String appointId)
    {
        return appointmentMapper.selectAppointmentByAppointId(appointId);
    }

    /**
     * 查询营地预约列表
     * 
     * @param appointment 营地预约
     * @return 营地预约
     */
    @Override
    public List<Appointment> selectAppointmentList(Appointment appointment)
    {
        return appointmentMapper.selectAppointmentList(appointment);
    }

    /**
     * 新增营地预约
     * 
     * @param appointment 营地预约
     * @return 结果
     */
    @Override
    public int insertAppointment(Appointment appointment)
    {
        appointment.setAppointId(IdUtils.randomUUID());
        return appointmentMapper.insertAppointment(appointment);
    }

    /**
     * 修改营地预约
     * 
     * @param appointment 营地预约
     * @return 结果
     */
    @Override
    public int updateAppointment(Appointment appointment)
    {
        return appointmentMapper.updateAppointment(appointment);
    }

    /**
     * 批量删除营地预约
     * 
     * @param appointIds 需要删除的营地预约主键
     * @return 结果
     */
    @Override
    public int deleteAppointmentByAppointIds(String[] appointIds)
    {
        return appointmentMapper.deleteAppointmentByAppointIds(appointIds);
    }

    /**
     * 删除营地预约信息
     * 
     * @param appointId 营地预约主键
     * @return 结果
     */
    @Override
    public int deleteAppointmentByAppointId(String appointId)
    {
        return appointmentMapper.deleteAppointmentByAppointId(appointId);
    }
}
